
#ifndef _TTG_STRUCTURES_GROUPING_
#define _TTG_STRUCTURES_GROUPING_
#include "Common/Definitions.h"

namespace ttg
{
	namespace structures
	{
		template <class El1, class El2 = El1>
		struct Pair
		{
			private:
				El1 e1;
				El2 e2;
			public:
				//For using inside stl.
				inline Pair()
						{ /*nothing*/}
				inline Pair(const El1 &e1, const El2 &e2)
				{
					this->e1 = e1;
					this->e2 = e2;
				}

				inline Pair(const Pair &pair)
				{
					this->e1 = pair.e1;
					this->e2 = pair.e2;
				}

				inline El1 &getFirst()
						{ return e1; }

				inline const El1 &getFirst() const
						{ return e1; }

				inline void setFirst(const El1 &val)
						{ e1 = val; }

				inline El2 &getSecond()
						{ return e2; }

				inline const El2 &getSecond() const
						{ return e2; }

				inline void setSecond(const El2 &val)
						{ e2 = val; }

				inline const Pair &operator =(const Pair &pair)
				{
					this->e1 = pair.e1;
					this->e2 = pair.e2;
					return *this;
				}

				inline bool operator >(const Pair &pair)
						{ return this->e1 > pair.e1; }
				inline bool operator <(const Pair &pair)
						{ return this->e1 < pair.e1; }

				inline bool operator !=(const Pair &pair)
						{ return this->e1 != pair.e1; }
				inline bool operator ==(const Pair &pair)
						{ return this->e1 == pair.e1; }
		};

		template <class El1, class El2 = El1, class El3 = El1>
		struct Triple
		{
			private:
				El1 e1;
				El2 e2;
				El3 e3;
			public:
				inline Triple()
						{/*nothing*/}

				inline Triple(const El1 &e1, const El2 &e2, const El3 &e3)
				{
					this->e1 = e1;
					this->e2 = e2;
					this->e3 = e3;
				}

				inline Triple(const Triple &triple)
				{
					this->e1 = triple.e1;
					this->e2 = triple.e2;
					this->e3 = triple.e3;
				}

				inline const El1 &getFirst() const
						{ return e1; }

				inline El1 &getFirst()
						{ return e1; }

				inline const El2 &getSecond() const
						{ return e2; }

				inline El2 &getSecond()
						{ return e2; }

				inline const El3 &getThird() const
						{ return e3; }

				inline El3 &getThird()
						{ return e3; }

				inline const Triple &operator =(const Triple &triple)
				{
					this->e1 = triple.e1;
					this->e2 = triple.e2;
					this->e3 = triple.e3;
					return *this;
				}
		};
	}
}

#endif
